package com.jiahua.user.biz.db;


public class JIAHUA {

//	final Logger logger = Logger.getLogger(JIAHUA.class.getName());
//
//	Connection conn = null;
//
//	public static void main(String[] args) {
//		JIAHUA jiahua = new JIAHUA();
//	}
//
//	public JIAHUA() {
//		conn = DatabaseUtil.connect();
//	}

//	// @SuppressWarnings("unused")
//	public boolean register(Customer customer) {
//		boolean result = true;
//		if (conn != null) {
//			try {
//				Statement statement = conn.createStatement();
//				String sql = "INSERT INTO customer" + " VALUES ('" + UUID.randomUUID().toString() + "',"
//						+ customer.getUsernum() + "," 
//						+ "'" + customer.getUserid() + "'" + "," 
//						+ "'" + customer.getLoginid() + "'" + ","
//						+ "'" + customer.getPostal() + "'" + "," 
//						+ "'" + customer.getAddress() + "'" + "," 
//						+ "'" + customer.getPhonenum() + "'" + "," 
//						+ "'" + customer.getBirthday() + "'" + "," 
//						+ "'" + customer.getUsername() + "'" + "," 
//						+ "'" + customer.getInitpsw() + "'" + "," 
//						+ "'" + customer.getPassword() + "'" + "," 
//						+ "'" + customer.getEmail() + "'" + ","
//						+ customer.getCreditpoint() + "," 
//						+ customer.getCount() + "," 
//						+ "'" + customer.getValidate() + "'" + ","
//						+ "'" + customer.getKind() + "'" + "," 
//					    + "'" + customer.getType() + "'" + "," 
//						+ "'" + customer.getLastestlogin() + "'" + ","
//						+ "'" + customer.getRegdate() + "'" + "," 
//						+ "'" + customer.getComment() + "'" + ")";
//				logger.info("AOSID : register() SQL -- > " + sql);
//				statement.executeUpdate(sql);
//			} catch (SQLException e) {
//				result = false;
//				e.printStackTrace();
//			}
//		}
//		DatabaseUtil.close();
//		return result;
//	}



//	public String getNewUserCount() {
//		Connection conn = DatabaseUtil.connect();
//		List columnNames = new ArrayList();
//		String num = "0";
//
//		if (conn != null) {
//			try {
//				Statement statement = conn.createStatement();
//				String query = "select count(1) from customer";
//				ResultSet resultSet = statement.executeQuery(query);
//
//				ResultSetMetaData metaData = resultSet.getMetaData();
//				int columnCount = metaData.getColumnCount();
//				for (int i = 0; i < columnCount; i++) {
//					columnNames.add(metaData.getColumnName(i + 1));
//				}
//				while (resultSet.next()) {
//					num = resultSet.getString(1);
//					logger.info("JIAHUA : total user number : " + num);
//				}
//
//			} catch (SQLException e) {
//				num = "0";
//				e.printStackTrace();
//			}
//		}
//
//		return num;
//	}


}
